﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.world {
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class GetRoomItemsCommand extends Command {

        public var event:InfoEvent;

        override public function execute():void{
            l(("c execute: " + this.execute));
            var _local1:RequestEvent = new RequestEvent(EventConstants.SEND_REQUEST, this.onResult);
            _local1.addRequest(ProtocolConstants.GET_ROOMITEMS, {id:this.event.id});
            dispatch(_local1);
        }
        private function onResult(_arg1:ResultVO):void{
            var _local2:Object;
            if (_arg1.success){
                _local2 = _arg1.data[ProtocolConstants.GET_ROOMITEMS];
                this.updateItems(_local2);
            };
        }
        private function updateItems(_arg1:Object):void{
            dispatch(new InfoEvent(EventConstants.CREATE_REWARD_ICONS, this.event.id, _arg1));
        }

    }
}//package net.wooga.pets.controllers.world 
